#ifndef __CALCEXCEPTION_H
#define __CALCEXCEPTION_H

#include <exception>
#include <string>

using namespace std;

/** A simple implementation of an exception with custom message.
 * It is thrown all around the code, but only the fact that it's
 * a derivative of exception is used.
 */
class CalcException : public exception {
  protected:
    /** Internal storage of message. */
    string cause;
    /** The overridden method. */
    virtual const char *what() const throw();

  public:
    /** Creates new exception with cause.
     *
     * @param s The cause to be printed.
     */
    CalcException(string s);
    /** Destructor conforming to base class.
     * This is necessary because GNU C++ creates a default constructor without
     * restriction on throw.
     */
    ~CalcException() throw();
};

#endif
